package com.travel.travelServer.utils;

import lombok.Data;

@Data
public class AjaxResult<E> {

    private Integer code;

    private E data;

    private String msg;

    public static <E>AjaxResult<E> success(E data) {
        AjaxResult result = new AjaxResult<>();
        result.setCode(200);
        result.setData(data);
        return result;
    }

    public static <E>AjaxResult<E> error(E data) {
        AjaxResult result = new AjaxResult<>();
        result.setCode(500);
        result.setData(data);
        return result;
    }
}
